package org.lee.mq.controller;

import org.lee.mq.NotifyMessageSender;
import org.lee.mq.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author jackielee
 * @version 1.0
 * @description HelloController
 * @date 2021/7/16
 **/
@RestController
@RequestMapping("/he")
public class HelloController {

    @Autowired
    private NotifyMessageSender sender;

    @GetMapping("/s")
    public String send() {
        sender.sendOrderPayNotify("hello " + StringUtil.Uuid(), new HashMap<>());
        return "pay";
    }

    @GetMapping("/s2")
    public String send2() {
        sender.sendOrderPayFinishNotify("hello " + StringUtil.Uuid(), new HashMap<>());
        return "pay finish";
    }

    @GetMapping("/r")
    public String send3() {
        sender.sendRefundNotify("hello " + StringUtil.Uuid(), new HashMap<>());
        return "refund";
    }

    @GetMapping("/r2")
    public String send4() {
        sender.sendRefundFinishNotify("hello " + StringUtil.Uuid(), new HashMap<>());
        return "refund finish";
    }
}
